package edu.hawaii.duedates.library;

import static org.junit.Assert.*;
import org.junit.Test;

/**
 * This will test the coverage of the LibraryType class.
 * 
 * @author Robin E. Raqueno and Ronn Reeves
 * 
 */
public class TestLibrary {

  /**
   * Testing the methods of the LibraryType class.
   */
  @Test
  public void testCreateLibraryType() {
    Library library = new Library();
    library.setName("Name");
    library.setLogin("Login");
    library.setPassword("Password");
    int id = library.hashCode();
    library.setUniqueId(id);
    boolean bool = library.getSelected(library);
    library.setLocation("location");

    assertEquals("getName failed.", library.getName(), "Name");
    assertEquals("getLogin failed.", library.getLogin(), "Login");
    assertEquals("getPassword failed.", library.getPassword(), "Password");
    assertEquals("getUniqueId failed.", library.getUniqueId(), id);
    assertFalse("Should return false.", bool);
    assertEquals("getLocation failed.", library.getLocation(), "location");
    
    library.setSelected(true);
    bool = library.getSelected(library);
    assertTrue("Should return true.", bool);
  }
}